package day0310;

import java.io.File;

public class FileDemo03 {

    public static void main(String[] args) {
        long l = System.currentTimeMillis();
        File file = new File("D:\\temp\\a.txt.txt");

        System.out.println(file.exists());

//        file.delete(); // 立即删除

        file.deleteOnExit(); // 虚拟机停止后删除

        try {
            Thread.sleep(1000 * 10);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        // 移动 + 重命名
//        boolean b = file.renameTo(new File("d:/temp/20230310.mp4"));
//        System.out.println(b);
        System.out.println(System.currentTimeMillis() - l);
    }
}
